import { CategroyListResultModel, CategroyModel } from './model/cateModel'
import { defHttp } from '/@/utils/http/axios'
const prefix = '/service.category/'
// api接口列表
enum Api {
  list = 'list',
  all = 'all',
  detail = 'detail',
  add = 'add',
  edit = 'edit',
  delete = 'delete',
}

/**
 * 获取列表
 * @param {*} params
 */
export const list = (params) => defHttp.get<CategroyListResultModel>({ url: prefix + Api.list, params })
/**
 * 获取列表
 * @param {*} params
 */
export const all = () => defHttp.get<CategroyListResultModel>({ url: prefix + Api.all })

/**
 * 获取单条记录信息
 * @param {*} params
 */
export const detail = (params) => defHttp.get<CategroyListResultModel>({ url: prefix + Api.detail, params })

/**
 * 新增平台用户
 * @param {*} data
 */
export const add = (data) => defHttp.post<any>({ url: prefix + Api.add, data })

/**
 * 编辑记录
 * @param {*} data
 */
export const edit = (data) => defHttp.post<any>({ url: prefix + Api.edit, data })

/**
 * 删除记录
 * @param {*} data
 */
export const deleted = (data) => defHttp.post<any>({ url: prefix + Api.delete, data })
